package com.java.lrw.service.impl;

import java.util.List;
import java.util.Set;

import com.java.common.pojo.Dept;
import com.java.common.pojo.Emp;
import com.java.lrw.dao.IDeptDAO;
import com.java.lrw.service.IDeptService;

public class DeptServiceImpl implements IDeptService {

	private IDeptDAO deptDAO;

	public void setDeptDAO(IDeptDAO deptDAO) {
		this.deptDAO = deptDAO;
	}

	public boolean newDept(Dept dept) {
		boolean b = deptDAO.newDept(dept);
		return b;
	}

	public int deptCount() {
		int i = deptDAO.deptCount();
		return i;
	}

	public List<Dept> deptlist(int start) {
		List<Dept> d = deptDAO.deptlist(start);
		return d;
	}

	public Dept getBelDept(Emp emp) {
		Dept d = deptDAO.getBelDept(emp);
		return d;
	}

	public Dept getDept(String deptId) {
		Dept  d = deptDAO.getDept(deptId);
		return d;
	}

	public Emp getEmp(String empId) {
		Emp e = deptDAO.getEmp(empId);
		return e;
	}
	
	public Set<Dept> getManDepts(Emp emp) {
		Set<Dept> d = deptDAO.getManDepts(emp);
		return d;
	}

	public int getManDeptsCount(Emp emp) {
		int i = deptDAO.getManDeptsCount(emp);
		return i;
	}

	public List<Dept> getSubDeptsByCondition(String[] conditions,
			String orderBy, int start, int count) {
		List<Dept> d = deptDAO.getSubDeptsByCondition(conditions, orderBy, start, count);
		return d;
	}

	public List<Dept> getSubManDepts(Emp emp, String[] conditions,
			String orderBy, int start, int count) {
		List<Dept> d = deptDAO.getSubManDepts(emp, conditions, orderBy, start, count);
		return d;
	}

	public boolean removeDept(String deptId) {
		boolean b = deptDAO.removeDept(deptId);
		return b;
	}

	public boolean updateDept(Dept dept) {
		boolean b = deptDAO.updateDept(dept);
		return b;
	}

}
